﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using FBWMS;

namespace FBWMS
{
    public partial class F_MasterMaintenance_Worker : Form
    {
        /// <summary>
        /// 僼傿乕儖僪
        /// </summary>
        private string strWork_ST = "";

        ////////////////////////////////////////////////////////////////////////////
        //
        //弶婜張棟
        //
        ////////////////////////////////////////////////////////////////////////////
        public F_MasterMaintenance_Worker()
        {
            string str_Message = string.Empty;
            string str_Caption = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_Error);
            try
            {
                //儘僌彂崬傒
                G_CommonClassSystem.G_System_SetLog(G_CommonDefine.LogMode.ProcStart, "F_MasterMaintenance_Worker start", "F_MasterMaintenance_Worker");

                //嵟廔儘僌僀儞帪娫傪妋擣偟僞僀儉傾僂僩偱偁傟偽F_LogIN夋柺傪昞帵偡傞丅
                if (G_CommonClassOther.G_Other_LoginTimeOut() == false)
                {
                    this.Close();
                    return;
                }

          

                //弶婜張棟
                InitializeComponent();

                //嶌嬈幰CD僐儞儃儃僢僋僗惗惉
                G_CommonClassControl.G_Control_MakeData_ComboBox(cmb_Work_CD, "Work_CD");
                //G_CommonClassControl.G_Control_MakeData_ComboBox(cmb_sTori_CD, "Tori_CD");
                //G_CommonClassControl.G_Control_MakeData_ComboBox_CustGroup(cmb_sGroup_CD);
                //this.cmb_sTori_CD.SelectedIndex = -1;
                //this.cmb_sGroup_CD.SelectedIndex = -1;
                //ToolTip偺愝掕
                G_CommonDefine.G_tt_ToolTip.RemoveAll();
                G_CommonDefine.G_tt_ToolTip.SetToolTip(this.btn_Search, "F1");
                G_CommonDefine.G_tt_ToolTip.SetToolTip(this.btn_Clear, "F11");
                G_CommonDefine.G_tt_ToolTip.SetToolTip(this.btn_Insert, "F4");
                G_CommonDefine.G_tt_ToolTip.SetToolTip(this.btn_Update, "F5");

                //儘僌彂崬傒
                G_CommonClassSystem.G_System_SetLog(G_CommonDefine.LogMode.ProcEnd, "F_MasterMaintenance_Worker End", "F_MasterMaintenance_Worker");
            }
            catch (Exception err)
            {
                //儘僌彂崬傒
                G_CommonClassSystem.G_System_SetLog(G_CommonDefine.LogMode.Error, "F_MasterMaintenance_Worker Error" + err.Message, "F_MasterMaintenance_Worker");

                //僄儔乕儊僢僙乕僕昞帵
                MessageBox.Show("F_MasterMaintenance_Worker" + err.Message, str_Caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }

        #region 僀儀儞僩僴儞僪儔 ***********************************************************

        ////////////////////////////////////////////////////////////////////////////
        //
        //専嶕儃僞儞僋儕僢僋帪張棟
        //
        ////////////////////////////////////////////////////////////////////////////
        private void btn_Search_Click(object sender, EventArgs e)
        {
            try
            {
                //懸婡夋柺偺昞帵
                G_CommonClassOther.G_Other_WaitForm(true);

                //儘僌彂崬傒
                G_CommonClassSystem.G_System_SetLog(G_CommonDefine.LogMode.ProcStart, "btn_Search_Click start", "btn_Search_Click");

                //専嶕張棟
                this.P_Search();                               

                //儘僌彂崬傒
                G_CommonClassSystem.G_System_SetLog(G_CommonDefine.LogMode.ProcEnd, "btn_Search_Click end", "btn_Search_Click");
            }
            catch (Exception ex)
            {
                //儘僌彂崬傒
                G_CommonClassSystem.G_System_SetLog(G_CommonDefine.LogMode.Error, "btn_Search_Click Error" + ex.Message, "btn_Search_Click");

                //僄儔乕儊僢僙乕僕昞帵
                string str_Caption = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_Error);
                MessageBox.Show("btn_Search_Click\n" + ex.Message, str_Caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                if (G_CommonDefine.G_F_COM_Waiting != null)
                {
                    //懸婡夋柺偺夝彍
                    G_CommonClassOther.G_Other_WaitForm(false);
                }
            }
        }       

        ////////////////////////////////////////////////////////////////////////////
        //
        //搊榐儃僞儞僋儕僢僋帪張棟
        //
        ////////////////////////////////////////////////////////////////////////////
        private void btn_Insert_Click(object sender, EventArgs e)
        {
            try
            {

                //擖椡僠僃僢僋
                if (!this.P_Check_Work_CD() ||              //嶌嬈幰CD
                    !this.P_Check_Work_ST("insert") ||      //僗僥乕僞僗
                    !this.P_Check_WKps_CD())                //僷僗儚乕僪
                {
                    return;
                }

                //懸婡夋柺偺昞帵
                G_CommonClassOther.G_Other_WaitForm(true);

                //儘僌彂崬傒
                G_CommonClassSystem.G_System_SetLog(G_CommonDefine.LogMode.ProcStart, "btn_Insert_Click start", "btn_Insert_Click");

                //搊榐張棟
                this.P_Insert();

                //儘僌彂崬傒
                G_CommonClassSystem.G_System_SetLog(G_CommonDefine.LogMode.ProcEnd, "btn_Insert_Click end", "btn_Insert_Click");
            }
            catch (Exception ex)
            {
                //儘僌彂崬傒
                G_CommonClassSystem.G_System_SetLog(G_CommonDefine.LogMode.Error, "btn_Insert_Click error" + ex.Message, "btn_Insert_Click");
                string str_Caption = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_Error);
                //僄儔乕儊僢僙乕僕昞帵
                MessageBox.Show("btn_Insert_Click\n" + ex.Message, str_Caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                if (G_CommonDefine.G_F_COM_Waiting != null)
                {
                    //懸婡夋柺偺夝彍
                    G_CommonClassOther.G_Other_WaitForm(false);
                }
            }
        }       

        ////////////////////////////////////////////////////////////////////////////
        //
        //峏怴儃僞儞僋儕僢僋帪張棟
        //
        ////////////////////////////////////////////////////////////////////////////
        private void btn_Update_Click(object sender, EventArgs e)
        {
            string str_Message = string.Empty;
            string str_Caption = string.Empty;

            try
            {
                //擖椡僠僃僢僋
                if (!this.P_Check_Work_ST("update") ||
                    !this.P_Check_WKps_CD())
                {
                    return;
                }

                //廋惓妋擣僟僀傾儘僌儃僢僋僗昞帵
                str_Message = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_ConfirmUpdate);
                str_Caption = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_Check);

                if (MessageBox.Show(str_Message, str_Caption, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.Cancel)
                {
                    return;
                }

                //懸婡夋柺偺昞帵
                G_CommonClassOther.G_Other_WaitForm(true);

                //儘僌彂崬傒
                G_CommonClassSystem.G_System_SetLog(G_CommonDefine.LogMode.ProcStart, "btn_Update_Click start", "btn_Update_Click");

                //峏怴張棟
                this.P_Update();

                //儘僌彂崬傒
                G_CommonClassSystem.G_System_SetLog(G_CommonDefine.LogMode.ProcEnd, "btn_Update_Click end", "btn_Update_Click");
            }
            catch (Exception ex)
            {
                //儘僌彂崬傒
                G_CommonClassSystem.G_System_SetLog(G_CommonDefine.LogMode.Error, "btn_Update_Click Error" + ex.Message, "btn_Update_Click");

                //僄儔乕儊僢僙乕僕昞帵
                str_Caption = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_Error);
                MessageBox.Show("btn_Update_Click\n" + ex.Message, str_Caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                if (G_CommonDefine.G_F_COM_Waiting != null)
                {
                    //懸婡夋柺偺夝彍
                    G_CommonClassOther.G_Other_WaitForm(false);
                }
            }
        }        
        
        ////////////////////////////////////////////////////////////////////////////
        //
        //僋儕傾儃僞儞僋儕僢僋帪張棟
        //
        ////////////////////////////////////////////////////////////////////////////
        private void btn_Clear_Click(object sender, EventArgs e)
        {
            try
            {
                //儘僌彂崬傒
                G_CommonClassSystem.G_System_SetLog(G_CommonDefine.LogMode.ProcStart, "btn_Clear_Click start", "btn_Clear_Click");
                
                //僋儕傾張棟
                this.P_Clear();

                //儘僌彂崬傒
                G_CommonClassSystem.G_System_SetLog(G_CommonDefine.LogMode.ProcEnd, "btn_Clear_Click end", "btn_Clear_Click");
            }
            catch (Exception ex)
            {
                //儘僌彂崬傒
                G_CommonClassSystem.G_System_SetLog(G_CommonDefine.LogMode.Error, "btn_Clear_Click Error" + ex.Message, "btn_Clear_Click");
                string str_Caption = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_Error);
                //僄儔乕儊僢僙乕僕昞帵
                MessageBox.Show("btn_Clear_Click" + ex.Message, str_Caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }            
        }       

        ////////////////////////////////////////////////////////////////////////////
        //
        //僗僥乕僞僗KeyPress帪張棟
        //
        ////////////////////////////////////////////////////////////////////////////
        private void txt_Work_ST_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar < '0' || e.KeyChar > '9')
            {
                if (e.KeyChar != '\b')
                {
                    e.Handled = true;
                }
            }
        }

        /// <summary>
        /// Delete operater information
        /// 
        /// Author:Michael
        /// Create Date:2008-11-08
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_Del_Click(object sender, EventArgs e)
        {
            try
            {
                G_CommonClassSystem.G_System_SetLog(G_CommonDefine.LogMode.ProcStart, "btn_Del_Click start", "btn_Del_Click");

                if (!P_Check_Work_CD())
                {
                    return;
                }

                P_Delete();

                G_CommonClassSystem.G_System_SetLog(G_CommonDefine.LogMode.ProcEnd, "btn_Del_Click end", "btn_Del_Click");
            }
            catch (Exception err)
            {

                G_CommonClassSystem.G_System_SetLog(G_CommonDefine.LogMode.Error, "btn_Del_Click Error "+ err.Message, "btn_Del_Click");
            }
        }
        
        #endregion **************************************************************************

        #region 僾儔僀儀乕僩娭悢 ***********************************************************

        /// <summary>
        /// 専嶕張棟
        /// </summary>
        private void P_Search()
        {
            //専嶕僨乕僞偺庢摼                
            //ds_F_MasterMaintenance_WorkerTableAdapters.USP_PC_F_MasterMaintenance_Worker_DataSelectTableAdapter ta = new ds_F_MasterMaintenance_WorkerTableAdapters.USP_PC_F_MasterMaintenance_Worker_DataSelectTableAdapter();

            string s = this.cmb_Work_CD.SelectedValue.ToString();

            //DataTable dt = ta.GetData(cmb_Work_CD.SelectedValue.ToString());
            DataTable dt;
            dt = G_CommonClassBussniss.G_F_MasterMaintenance_Worker_GetData(s);

            if (dt == null || dt.Rows.Count == 0)
            {
                string str_Message = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_DataNotExist);
                MessageBox.Show(str_Message);
                return;
            }

            //懳徾僨乕僞傪夋柺忋偵僙僢僩
            this.txt_Work_CD.Text = dt.Rows[0]["Work_CD"].ToString();
            this.txt_Work_NM.Text = dt.Rows[0]["Work_NM"].ToString();
            this.txt_Work_ST.Text = dt.Rows[0]["Work_ST"].ToString();
            this.txt_Reg_DT.Text = dt.Rows[0]["Reg_DT"].ToString();

            this.cmb_sTori_CD.SelectedValue = dt.Rows[0]["Tori_CD"].ToString();
            this.cmb_sGroup_CD.SelectedValue = dt.Rows[0]["Group_CD"].ToString();

            this.txt_WKps_CD.Text = G_CommonClassEncrypt.G_Encrypt_DecryptString(dt.Rows[0]["WKps_CD"].ToString(), G_CommonDefine.G_EncryptKey);

            strWork_ST = this.txt_Work_ST.Text;

            this.btn_Insert.Enabled = false;
            this.btn_Update.Enabled = true;
            this.btn_Del.Enabled = true;

            this.cmb_Work_CD.Enabled = false;
            this.txt_Work_CD.Enabled = false;
        }

        /// <summary>
        /// 搊榐張棟
        /// </summary>
        private void P_Insert()
        {
 
            int result = 0;
            string str_Work_CD = this.txt_Work_CD.Text;
            string str_Work_NM = this.txt_Work_NM.Text;
            string str_Work_ST = this.txt_Work_ST.Text;
            string str_WKps_CD = G_CommonClassEncrypt.G_Encrypt_EncryptString(this.txt_WKps_CD.Text, G_CommonDefine.G_EncryptKey);
            string str_Tori_CD = string.Empty;
            string str_Group_CD = string.Empty;

            if((this.cmb_sGroup_CD.Text.Trim().Length>0)&&(this.cmb_sTori_CD.SelectedValue !=null))
            {
                str_Tori_CD = this.cmb_sTori_CD.SelectedValue.ToString();
            }
            if ((this.cmb_sGroup_CD.Text.Trim().Length>0)&&(this.cmb_sGroup_CD.SelectedValue != null))
            {
                str_Group_CD = this.cmb_sGroup_CD.SelectedValue.ToString();
            }

            result = G_CommonClassBussniss.G_F_MasterMaintenace_Worker_Insert(str_Work_CD, str_Work_NM, str_Work_ST, str_WKps_CD,str_Tori_CD,str_Group_CD);
            string str_Message = string.Empty;
            string str_Caption = string.Empty;
            switch (result)
            {
                case 0:
                    str_Message = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_InsertSuccess);
                    str_Caption = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_End);
                    MessageBox.Show(str_Message, str_Caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.P_Clear();
                    //嶌嬈幰CD僐儞儃儃僢僋僗惗惉
                    G_CommonClassControl.G_Control_MakeData_ComboBox(cmb_Work_CD, "Work_CD");
                    break;
                case -1:
                    str_Message = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_DataAlreadyExist);
                    str_Caption = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_Error);
                    MessageBox.Show(str_Message, str_Caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    txt_Work_CD.Focus();
                    break;
                case 99:
                    str_Message = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_InsertFail);
                    str_Caption = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_Error);
                    MessageBox.Show(str_Message, str_Caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    break;
                default:
                    break;
            }
        }

        /// <summary>
        /// 峏怴張棟
        /// </summary>
        private void P_Update()
        {
 
            int result = 0;
            string str_Work_CD = txt_Work_CD.Text;
            string str_Work_NM = txt_Work_NM.Text;
            string str_Work_ST = txt_Work_ST.Text;
            string str_WKps_CD = G_CommonClassEncrypt.G_Encrypt_EncryptString(this.txt_WKps_CD.Text, G_CommonDefine.G_EncryptKey);

            string str_Tori_CD = string.Empty;
            string str_Group_CD = string.Empty;

            if (this.cmb_sTori_CD.SelectedValue != null)
            {
                str_Tori_CD = this.cmb_sTori_CD.SelectedValue.ToString();
            }
            if (this.cmb_sGroup_CD.SelectedValue != null)
            {
                str_Group_CD = this.cmb_sGroup_CD.SelectedValue.ToString();
            }

            result = G_CommonClassBussniss.G_F_MasterMaintenace_Worker_Update(str_Work_CD, str_Work_NM, str_Work_ST, str_WKps_CD,str_Tori_CD,str_Group_CD);
            string str_Message = string.Empty;
            string str_Caption = string.Empty;

            //儕僞乕儞敾掕
            switch (result)
            {
                case 0:
                    str_Message = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_UpdateSuccess);
                    str_Caption = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_End);
                    MessageBox.Show(str_Message, str_Caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.P_Clear();
                    //嶌嬈幰CD僐儞儃儃僢僋僗惗惉
                    G_CommonClassControl.G_Control_MakeData_ComboBox(cmb_Work_CD, "Work_CD");
                    break;
                case -2:
                    str_Message = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_DataNotExist);
                    str_Caption = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_Error);
                    MessageBox.Show(str_Message, str_Caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    break;
                case 99:
                    str_Message = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_UpdateFail);
                    str_Caption = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_Error);
                    MessageBox.Show(str_Message, str_Caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    break;
                default:
                    break;
            }
        }

        /// <summary>
        /// 僋儕傾張棟
        /// </summary>
        private void P_Clear()
        {
            this.cmb_Work_CD.SelectedIndex = 0;

            this.txt_Work_CD.Text = "";
            this.txt_Work_NM.Text = "";
            this.txt_Work_ST.Text = "";
            this.txt_Reg_DT.Text = "";
            this.txt_WKps_CD.Text = "";

            this.btn_Insert.Enabled = true;
            this.btn_Update.Enabled = false;
            this.btn_Del.Enabled = false;
            this.cmb_Work_CD.Enabled = true;
            this.txt_Work_CD.Enabled = true;

            this.cmb_sTori_CD.SelectedIndex = -1;
            this.cmb_sTori_CD.Text = string.Empty;
            this.cmb_sGroup_CD.SelectedIndex = -1;
            this.cmb_sGroup_CD.Text = string.Empty;

            this.cmb_Work_CD.Focus();
        }

        /// <summary>
        /// Delete Record
        /// </summary>
        private void P_Delete()
        {
            string str_Message = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_ConfirmDelete);
            string str_Caption = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_Check);

            if (MessageBox.Show(str_Message, str_Caption, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
            {
                return;
            }

            string str_Work_CD = this.txt_Work_CD.Text.Trim();

            int result = G_CommonClassBussniss.G_F_MasterMaintenace_Worker_Delete(str_Work_CD);

            switch (result)
            {
                case 0:
                    str_Message = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_DeleteSuccess);
                    str_Caption = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_End);
                    MessageBox.Show(str_Message, str_Caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    break;
                case -3:
                    str_Message = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_DataNotExist);
                    str_Caption = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_Error);
                    MessageBox.Show(str_Message, str_Caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                case -1:
                default:
                    str_Message = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_DeleteFail);
                    str_Caption = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_Error);
                    MessageBox.Show(str_Message, str_Caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
            }

            P_Clear();
            G_CommonClassControl.G_Control_MakeData_ComboBox(cmb_Work_CD, "Work_CD");
        }

        #endregion *************************************************************************        

        #region 擖椡僠僃僢僋娭悢 ***********************************************************

        /// <summary>
        /// 嶌嬈幰僐乕僪擖椡僠僃僢僋
        /// </summary>
        private bool P_Check_Work_CD()
        {
            string str_Message = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_F_Worker_Work_CD);
            string str_Caption = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_Error);
            if (!G_CommonClassChk.G_Chk_Null(txt_Work_CD.Text))
            {
                MessageBox.Show(str_Message, str_Caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                txt_Work_CD.Focus();
                return false;
            }

            return true;
        }

        /// <summary>
        /// 僗僥乕僞僗擖椡僠僃僢僋
        /// </summary>
        private bool P_Check_Work_ST(string strMode)
        {
            string str_Message = string.Empty;
            string str_Caption = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_Error) ;

            if (!G_CommonClassChk.G_Chk_Null(txt_Work_ST.Text))
            {
                str_Message = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_F_Worker_WorkST01);
                MessageBox.Show(str_Message, str_Caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                txt_Work_ST.Focus();
                return false;
            }

            if (txt_Work_ST.Text.CompareTo(G_CommonDefine.G_WorkST) > 0)
            {
                str_Message = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_F_Worker_WorkST02);
                //MessageBox.Show("自分の権限以上のステータスは認められません。", str_Caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                MessageBox.Show(str_Message, str_Caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                txt_Work_ST.Focus();
                return false;
            }

            if (strMode.Equals("update") && strWork_ST.CompareTo(G_CommonDefine.G_WorkST) > 0)
            {
                str_Message = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_F_Worker_WorkST02);
                //MessageBox.Show("自分の権限以上のステータスは認められません。", str_Caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                MessageBox.Show(str_Message, str_Caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                txt_Work_ST.Focus();
                return false;
            }

            return true;
        }

        /// <summary>
        /// 僷僗儚乕僪擖椡僠僃僢僋
        /// </summary>
        private bool P_Check_WKps_CD()
        {
            string str_Message = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_PasswordNotSpace);
            string str_Caption = G_CommonClassSystem.G_System_GetMessage(G_CommonDefine.G_Message_Error);
            if (!G_CommonClassChk.G_Chk_Null(this.txt_WKps_CD.Text))
            {
                //MessageBox.Show("パスワードを入力して下さい。", "僄儔乕", MessageBoxButtons.OK, MessageBoxIcon.Error);
                MessageBox.Show(str_Message, str_Caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.txt_WKps_CD.Focus();
                return false;
            }

            return true;
        }

        

        #endregion *************************************************************************

        #region 僼僅乕儉嫟捠張棟 ***********************************************************

        ////////////////////////////////////////////////////////////////////////////
        //
        //僔儑乕僩僇僢僩僉乕張棟
        //
        ////////////////////////////////////////////////////////////////////////////
        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            if (this.cc_ShortcutKeyHelper1.PerformClickByKeys(keyData))
            {
                return true;
            }

            return base.ProcessCmdKey(ref msg, keyData);
        }

        ////////////////////////////////////////////////////////////////////////////
        //
        //僼僅乕儉KeyDown帪張棟
        //(僄儞僞乕傪墴偟偨嵺偵師偺僐儞僩儘乕儖偵堏摦偡傞丅)
        //(僼僅乕儉偺亀KeyPreview亁傪亀true亁偵偡傞偙偲)
        ////////////////////////////////////////////////////////////////////////////
        private void F_MasterMaintenance_Worker_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                if (!e.Control)
                {
                    this.SelectNextControl(this.ActiveControl, !e.Shift, true, true, true);
                }
            }
        }

        #endregion *************************************************************************

    }
}